package com.hcf.admin.controller;

import com.hcf.admin.common.convention.result.Result;
import com.hcf.admin.common.convention.result.ResultTool;
import com.hcf.admin.remote.ShortLinkProjectService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/shortlink/admin/v1")
public class UrlTitleController {

    ShortLinkProjectService shortLinkProjectService = new ShortLinkProjectService(){};

    /**
     * 根据URL获取对应网站的标题
     * @param url
     * @return
     */
    @RequestMapping("/title")
    public Result<String> getUrlTitle(@RequestParam("url") String url) {

        return shortLinkProjectService.getUrlTitle(url);
    }
}
